/*
 * based jquery
 * */
window.Toolkit = {};

Toolkit.validate = (function(){
		
	return {
			minLength : function(string , length){
				if(string.length < length){
					return false;
				}
				return true;
			},
			
			isEmail : function(emailStr){
				if(emailStr.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1){
					return true;
				}else{
					return false;
				}
			},
			
			isEmpty : function(string , blankAllow){
				if(!blankAllow){
					string = $.trim(string);
				}
				if(string === ""){
					return true;
				}else{
					return false;
				}
			},
			
			isEqual : function(str1 , str2){
				if(str1 === str2){
					return true;
				}else{
					return false;
				}
			}
		}
})();

Toolkit.adjustIframeSize = function(frm )
 {
    frm.oldID = frm.id;
    frm.id = "iframe_" + (new Date()).valueOf();
    var doc = document.frames ? document.frames[frm.id].document : frm.contentDocument;
           
    if(frm != null && doc != null)
    {
         frm.style.height="0px";
         frm.style.height = doc.documentElement.scrollHeight+"px";
         frm.style.width = doc.documentElement.scrollWidth+"px";
         doc.body.style.overflowX="hidden";
         doc.body.style.overflowY="hidden";
    }
    frm.id = frm.oldID;
    frm.oldID = null;
    
    doc.onresize = function(){
    	
    	alert("resized");
    }
}
